# coding: utf-8
from sqlalchemy import BigInteger, Column, Date, DateTime, Float, Index, Integer, SmallInteger, String, Table, Text
from sqlalchemy.schema import FetchedValue
from flask_sqlalchemy import SQLAlchemy


db = SQLAlchemy()



class CdbComment(db.Model):
    __tablename__ = 'cdb_comment'
    __table_args__ = (
        db.Index('type_typeid', 'type', 'type_id'),
    )

    id = db.Column(db.Integer, primary_key=True)
    uid = db.Column(db.Integer, nullable=False, index=True, info='评论人uid')
    type = db.Column(db.String(25), nullable=False, info='评论类型')
    type_id = db.Column(db.Integer, nullable=False, info='被评论类型的id')
    create_time = db.Column(db.DateTime, info='创建时间')
    topid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue())
    parentid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue())
    content = db.Column(db.Text, info='事件内容')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='评论状态，0 删除，1可见')



class CdbConcern(db.Model):
    __tablename__ = 'cdb_concern'

    id = db.Column(db.Integer, primary_key=True)
    uid = db.Column(db.Integer, nullable=False, info='关注人uid')
    thread_id = db.Column(db.Integer, nullable=False, index=True, info='帖子 id')
    type = db.Column(db.String(32), nullable=False, info='主帖类型')



class CdbConcernCount(db.Model):
    __tablename__ = 'cdb_concern_count'
    __table_args__ = (
        db.Index('type_type_id', 'type', 'type_id'),
    )

    id = db.Column(db.Integer, primary_key=True)
    concern_num = db.Column(db.Integer, nullable=False, info='关注数量')
    type = db.Column(db.String(25), nullable=False, info='关注类型')
    type_id = db.Column(db.Integer, nullable=False, info='被关注类型的id')



class CdbCostCensu(db.Model):
    __tablename__ = 'cdb_cost_census'

    id = db.Column(db.Integer, primary_key=True, info='ID ')
    uid = db.Column(db.Integer, nullable=False, info='用户ID')
    task_id = db.Column(db.Integer, nullable=False, info='项目ID')
    year = db.Column(db.Integer, nullable=False, info='年')
    month = db.Column(db.Integer, nullable=False, info='月')
    quarter = db.Column(db.Integer, nullable=False, info='季度')
    rate = db.Column(db.Float, nullable=False, info='占比')
    create_time = db.Column(db.Integer, nullable=False, info='创建时间')



class CdbDepartment(db.Model):
    __tablename__ = 'cdb_department'

    id = db.Column(db.SmallInteger, primary_key=True)
    parent_id = db.Column(db.SmallInteger, nullable=False, info='父级id')
    name = db.Column(db.String(32), nullable=False, info='事件类型')



class CdbDepartmentBak(db.Model):
    __tablename__ = 'cdb_department_bak'

    id = db.Column(db.SmallInteger, primary_key=True)
    parent_id = db.Column(db.SmallInteger, nullable=False, info='父级id')
    name = db.Column(db.String(32), nullable=False, info='事件类型')



class CdbDepartmentMember(db.Model):
    __tablename__ = 'cdb_department_member'

    id = db.Column(db.SmallInteger, primary_key=True)
    uid = db.Column(db.Integer, nullable=False, info='用户id')
    department_id = db.Column(db.SmallInteger, nullable=False, info='部门id')
    role = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='角色 0 普通员工 1 管理员')



class CdbDingCodeToUserid(db.Model):
    __tablename__ = 'cdb_ding_code_to_userid'

    id = db.Column(db.Integer, primary_key=True)
    code = db.Column(db.String(32), nullable=False, unique=True, info='ding code')
    userid = db.Column(db.String(32), nullable=False, info='ding userid')



class CdbDingTalk(db.Model):
    __tablename__ = 'cdb_ding_talk'

    id = db.Column(db.Integer, primary_key=True)
    task_id = db.Column(db.Integer, nullable=False)
    owner_uid = db.Column(db.Integer, nullable=False)
    content = db.Column(db.String(255), nullable=False)
    create_time = db.Column(db.Integer, nullable=False)
    type = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue())



class CdbDinnerMenu(db.Model):
    __tablename__ = 'cdb_dinner_menu'

    id = db.Column(db.Integer, primary_key=True)
    week = db.Column(db.SmallInteger, nullable=False, index=True, info='周几')
    name = db.Column(db.String(32), nullable=False, info='名称')



class CdbDinnerOrder(db.Model):
    __tablename__ = 'cdb_dinner_order'

    id = db.Column(db.Integer, primary_key=True)
    uid = db.Column(db.Integer, nullable=False, index=True)
    create_time = db.Column(db.DateTime, info='创建时间')
    create_date = db.Column(db.Integer, info='创建日期')
    is_del = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='0 未删除， 1 已删除')



class CdbDinnerOrderDetail(db.Model):
    __tablename__ = 'cdb_dinner_order_detail'

    id = db.Column(db.Integer, primary_key=True)
    order_id = db.Column(db.Integer, nullable=False, index=True, info='cdb_dinner_order 中的id')
    food_id = db.Column(db.Integer, nullable=False, info='菜单id')
    price = db.Column(db.String(32), nullable=False, info='价格')
    num = db.Column(db.SmallInteger, nullable=False, server_default=db.FetchedValue())



class CdbDinnerShop(db.Model):
    __tablename__ = 'cdb_dinner_shop'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(32), nullable=False, info='店铺名称')
    tel = db.Column(db.String(64), nullable=False, info='联系电话')



class CdbFaqTag(db.Model):
    __tablename__ = 'cdb_faq_tag'
    __table_args__ = (
        db.Index('type_tag', 'type', 'tag'),
    )

    id = db.Column(db.Integer, primary_key=True)
    fid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='父级标签id')
    type = db.Column(db.String(25), nullable=False, info='help 求助')
    tag = db.Column(db.String(25), nullable=False, info='标签名称')
    relate_num = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='tag关联的faq数量')
    is_del = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否被删除')



class CdbHelpFaqId(db.Model):
    __tablename__ = 'cdb_help_faq_id'

    id = db.Column(db.Integer, primary_key=True, info='使用此id作为es 中的id')
    faq = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info=' 无意义的字段，只为生成id，使用id作为es 中的id')



class CdbIdeaRewarded(db.Model):
    __tablename__ = 'cdb_idea_rewarded'

    id = db.Column(db.Integer, primary_key=True)
    thread_id = db.Column(db.Integer, nullable=False, index=True, info='点子库主帖id')
    dateline = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='添加时间')
    is_del = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='记录是否被删除 1 被删除，0 未被删除')



class CdbKeyValue(db.Model):
    __tablename__ = 'cdb_key_value'

    skey = db.Column(db.String(255), primary_key=True, index=True, server_default=db.FetchedValue())
    svalue = db.Column(db.Text, nullable=False)



class CdbMeetingRecord(db.Model):
    __tablename__ = 'cdb_meeting_record'

    id = db.Column(db.Integer, primary_key=True)
    department = db.Column(db.String(24), nullable=False, server_default=db.FetchedValue(), info='部门名称')
    safe_type = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='安全类型 1 全员可见，2 参与人员、抄送人员')
    subject = db.Column(db.String(128), nullable=False, info='标题')
    meeting_type = db.Column(db.String(16), nullable=False, server_default=db.FetchedValue(), info='会议类型  部门例会，产品需求会')
    members = db.Column(db.Text, info='参会人员')
    start_datetime = db.Column(db.DateTime, info='开始时间')
    end_datetime = db.Column(db.DateTime, info='结束实际')
    conent = db.Column(db.Text, info='会议内容')
    is_del = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否被删除，0未被删除 1 已被删除')
    creator_uid = db.Column(db.Integer, nullable=False, info='创建人id')
    create_date = db.Column(db.DateTime, nullable=False, info='创建时间')
    update_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='更新人id')
    update_date = db.Column(db.DateTime, nullable=False, info='更新时间')



class CdbMemberActlog(db.Model):
    __tablename__ = 'cdb_member_actlog'

    id = db.Column(db.Integer, primary_key=True)
    uid = db.Column(db.Integer, nullable=False, index=True, info='uid')
    type = db.Column(db.String(25), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')



class CdbMonitorUrl(db.Model):
    __tablename__ = 'cdb_monitor_url'

    id = db.Column(db.Integer, primary_key=True)
    url_id = db.Column(db.Integer, nullable=False, index=True, info='页面url')
    status = db.Column(db.SmallInteger, nullable=False, info='页面状态')
    execute_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='页面执行多长时间 单位 ms   毫秒 ')
    dateline = db.Column(db.Integer, nullable=False, index=True, info='创建时间')
    ip = db.Column(db.String(64), nullable=False, info='ip地址')



class CdbMonitorUrlConfig(db.Model):
    __tablename__ = 'cdb_monitor_url_config'

    id = db.Column(db.Integer, primary_key=True)
    url = db.Column(db.String(255), unique=True, server_default=db.FetchedValue(), info='页面url')
    title = db.Column(db.String(255), unique=True, server_default=db.FetchedValue(), info='标题')
    time_interval = db.Column(db.SmallInteger, server_default=db.FetchedValue(), info='间隔时间')
    operator_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue())
    create_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue())



class CdbProjectCreateByTask(db.Model):
    __tablename__ = 'cdb_project_create_by_task'

    id = db.Column(db.Integer, primary_key=True)
    project_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='项目ID')
    task_id = db.Column(db.Integer, unique=True, server_default=db.FetchedValue(), info='成员ID')



class CdbQueueList(db.Model):
    __tablename__ = 'cdb_queue_list'

    id = db.Column(db.Integer, primary_key=True)
    type = db.Column(db.String(16), nullable=False, info='类型')
    type_id = db.Column(db.Integer, info='类型id')
    content = db.Column(db.Text, info='可以存储 json 格式字符串。')



class CdbSaleTarget(db.Model):
    __tablename__ = 'cdb_sale_target'

    id = db.Column(db.Integer, primary_key=True)
    project = db.Column(db.String(24), nullable=False, info='项目名称:kashangbao ')
    salesman = db.Column(db.String(8), nullable=False, info='销售员名称')
    amount = db.Column(db.Integer, nullable=False, info='销售目标,单位元')
    target_type = db.Column(db.String(24), nullable=False, info='类型：新签，续签，团签')
    monthDate = db.Column(db.DateTime, nullable=False, info='目标月份日期，以开始月份表示当月目标的时间范围')



class CdbSalesInfo(db.Model):
    __tablename__ = 'cdb_sales_info'

    id = db.Column(db.Integer, primary_key=True)
    contractType = db.Column(db.Integer, nullable=False, info='合同类型（1：个人，2：团单，3：三方协议个签，4：三方协议团签')
    contractDateBegin = db.Column(db.DateTime, info='合同开始时间')
    contractDateEnd = db.Column(db.DateTime, info='合同结束时间')
    serverType = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='合作服务类型（1：卡销宝，2：标准版卡商宝，3：标准版卡商宝套餐，4：豪华版卡商宝套餐，5：豪华版卡商宝套餐（标升豪））')
    paymentsType = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='收款主体（1：卡车之家，2：天津罗工）')
    customerId = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='客户id')
    customerName = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='客户名称')
    dealerId = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='经销商id')
    dealerName = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='经销商名称')
    manufacturerId = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='制造商id')
    manufacturerName = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='制造商名称')
    provinceId = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='省份id')
    provinceName = db.Column(db.String(24), nullable=False, server_default=db.FetchedValue(), info='省份名称')
    cityId = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='城市id')
    cityName = db.Column(db.String(24), nullable=False, server_default=db.FetchedValue(), info='城市名称')
    newStatus = db.Column(db.Integer, nullable=False, info='合同新续签状态（1：新签，2：续签）')
    salesman = db.Column(db.String(24), nullable=False, info='销售员 小合同落区域经理名称，大合同落集采负责人')
    shortName = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='合同简称')
    amount = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='合同金额（单位：元）')
    subsidiesType = db.Column(db.Integer, nullable=False, info='补贴类型（厂商全部付款、厂商部分付款、报销）')
    subsidiesAmount = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='补贴金额（单位：元）')
    createDate = db.Column(db.DateTime, nullable=False, info='合同创建时间')
    districtId = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='大区id')
    districtName = db.Column(db.String(24), nullable=False, server_default=db.FetchedValue(), info='大区名称')
    sys_date = db.Column(db.DateTime, nullable=False, info='同步日期')



class CdbSalesInput(db.Model):
    __tablename__ = 'cdb_sales_input'

    id = db.Column(db.Integer, primary_key=True)
    department = db.Column(db.String(24), nullable=False, info='部门')
    type = db.Column(db.String(24), nullable=False, info='类别：二手车，驾校，TOC，品牌广告')
    start_date = db.Column(db.DateTime, info='开始时间')
    end_date = db.Column(db.DateTime, info='结束时间')
    money = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='金额 单位 元')
    creator_uid = db.Column(db.Integer, nullable=False, info='创建人')
    create_date = db.Column(db.DateTime, info='创建时间')
    is_del = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否删除')
    update_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='更新者用户id')
    update_date = db.Column(db.DateTime, info='更新日期')



class CdbSalesmanDistrict(db.Model):
    __tablename__ = 'cdb_salesman_district'

    id = db.Column(db.Integer, primary_key=True)
    salesman = db.Column(db.String(8), nullable=False, unique=True, info='销售员名称')
    districtName = db.Column(db.String(8), nullable=False, info='大区名称')



class CdbShareMeeting(db.Model):
    __tablename__ = 'cdb_share_meeting'

    id = db.Column(db.Integer, primary_key=True)
    create_uid = db.Column(db.Integer, nullable=False, index=True, info='创建人uid')
    create_time = db.Column(db.DateTime, info='创建时间')
    uid = db.Column(db.Integer, nullable=False, info='主持者，分享者 uid')
    start_time = db.Column(db.DateTime, info='选择开始时间')
    end_time = db.Column(db.DateTime, index=True, info='选择结束时间')
    title = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='主题')
    link_url = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='链接地址')
    address = db.Column(db.String(8), nullable=False, server_default=db.FetchedValue(), info='地点：中卡、重卡、轻卡')
    update_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='修改人uid')
    is_del = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否删除')



class CdbTask(db.Model):
    __tablename__ = 'cdb_task'
    __bind_key__ = 'venus'

    __table_args__ = (
        db.Index('uid_displayorder', 'owner_uid', 'display_order'),
    )

    id = db.Column(db.Integer, primary_key=True)
    project_id = db.Column(db.Integer, nullable=False, index=True, info='任务模块id')
    fid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='父级任务 ID')
    assignor_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='指派人uid')
    owner_uid = db.Column(db.Integer, nullable=False, index=True, server_default=db.FetchedValue(), info='任务所属 用户id')
    level = db.Column(db.String(15), nullable=False, server_default=db.FetchedValue(), info='任务等级，不同等级对应不同颜色')
    type = db.Column(db.String(15), nullable=False, server_default=db.FetchedValue(), info='任务泳道类型 todo，doing，done，story')
    create_time = db.Column(db.DateTime, index=True, info='创建时间')
    subject = db.Column(db.String(128), info='标题')
    description = db.Column(db.Text, info='详细描述')
    remarks = db.Column(db.Text, info='备注')
    check_list = db.Column(db.Text, info='检查列表，json字符串')
    start_time = db.Column(db.DateTime, info='开始时间')
    end_time = db.Column(db.DateTime, info='完成时间')
    plan_start_time = db.Column(db.DateTime, info='计划开始时间')
    plan_end_time = db.Column(db.DateTime, info='计划结束时间')
    create_uid = db.Column(db.Integer, nullable=False, info='创建用户id')
    attachement = db.Column(db.Text, info='附件，文件，图片等信息,以 | 分隔')
    display_order = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='展示顺序，-1不显示')
    last_update_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='最后一次更新时，用户的id')
    swim_lane = db.Column(db.String(15), nullable=False, server_default=db.FetchedValue(), info='泳道(任务可以在不同的泳道移动) Stroy,To do，Doing，Done')
    comment_num = db.Column(db.SmallInteger, nullable=False, server_default=db.FetchedValue(), info='评论数')
    link_list = db.Column(db.Text, info='任务链接地址')
    category_business = db.Column(db.String(8), nullable=False, server_default=db.FetchedValue())
    category_product = db.Column(db.String(16), nullable=False, server_default=db.FetchedValue())
    execute_type = db.Column(db.String(20), nullable=False, info='执行类型')
    version = db.Column(db.String(16), nullable=False, server_default=db.FetchedValue())



class CdbTaskCheckList(db.Model):
    __tablename__ = 'cdb_task_check_list'
    __table_args__ = (
        db.Index('task_id_display_order', 'task_id', 'display_order'),
    )

    id = db.Column(db.Integer, primary_key=True)
    task_id = db.Column(db.Integer, nullable=False, index=True, info='任务id')
    uid = db.Column(db.Integer, nullable=False, info='操作人uid')
    create_time = db.Column(db.DateTime, info='创建时间')
    status = db.Column(db.Integer, server_default=db.FetchedValue(), info='状态 0 未完成  1 已完成')
    content = db.Column(db.Text)
    display_order = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='展示顺序 0 不显示 大于1 显示')



class CdbTaskCopy1(db.Model):
    __tablename__ = 'cdb_task_copy1'
    __table_args__ = (
        db.Index('uid_displayorder', 'owner_uid', 'display_order'),
    )

    id = db.Column(db.Integer, primary_key=True)
    project_id = db.Column(db.Integer, nullable=False, index=True, info='任务模块id')
    fid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='父级任务 ID')
    assignor_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='指派人uid')
    owner_uid = db.Column(db.Integer, nullable=False, index=True, server_default=db.FetchedValue(), info='任务所属 用户id')
    level = db.Column(db.String(15), nullable=False, server_default=db.FetchedValue(), info='任务等级，不同等级对应不同颜色')
    type = db.Column(db.String(15), nullable=False, server_default=db.FetchedValue(), info='任务泳道类型 todo，doing，done，story')
    create_time = db.Column(db.DateTime, index=True, info='创建时间')
    subject = db.Column(db.String(128), info='标题')
    description = db.Column(db.Text, info='详细描述')
    remarks = db.Column(db.Text, info='备注')
    check_list = db.Column(db.Text, info='检查列表，json字符串')
    start_time = db.Column(db.DateTime, info='开始时间')
    end_time = db.Column(db.DateTime, info='完成时间')
    plan_start_time = db.Column(db.DateTime, info='计划开始时间')
    plan_end_time = db.Column(db.DateTime, info='计划结束时间')
    create_uid = db.Column(db.Integer, nullable=False, info='创建用户id')
    attachement = db.Column(db.Text, info='附件，文件，图片等信息,以 | 分隔')
    display_order = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='展示顺序，-1不显示')
    last_update_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='最后一次更新时，用户的id')
    swim_lane = db.Column(db.String(15), nullable=False, server_default=db.FetchedValue(), info='泳道(任务可以在不同的泳道移动) Stroy,To do，Doing，Done')
    comment_num = db.Column(db.SmallInteger, nullable=False, server_default=db.FetchedValue(), info='评论数')
    link_list = db.Column(db.Text, info='任务链接地址')
    category_business = db.Column(db.String(8), nullable=False, server_default=db.FetchedValue())
    category_product = db.Column(db.String(16), nullable=False, server_default=db.FetchedValue())
    version = db.Column(db.String(16), nullable=False, server_default=db.FetchedValue())



class CdbTaskDel(db.Model):
    __tablename__ = 'cdb_task_del'

    id = db.Column(db.Integer, primary_key=True)
    task_id = db.Column(db.Integer, nullable=False, index=True, info='任务id')
    uid = db.Column(db.Integer, nullable=False, info='用户id')
    display_order = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='展示顺序，-1不显示')
    create_time = db.Column(db.DateTime, info='创建时间')



class CdbTaskExpendOp(db.Model):
    __tablename__ = 'cdb_task_expend_ops'

    id = db.Column(db.Integer, primary_key=True)
    task_id = db.Column(db.Integer, nullable=False, unique=True, info='任务id')
    target_project_id = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='要上线目标项目id')
    document = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='上传的文档，每个任务只有一个')
    readme = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='readme文档')
    test_report_type = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue(), info='测试报告类型')
    test_member = db.Column(db.String(64), nullable=False, server_default=db.FetchedValue(), info='测试人员')



class CdbTaskLinkList(db.Model):
    __tablename__ = 'cdb_task_link_list'

    id = db.Column(db.Integer, primary_key=True)
    task_id = db.Column(db.Integer, nullable=False, index=True, info='任务id')
    uid = db.Column(db.Integer, nullable=False, info='操作人uid')
    create_time = db.Column(db.DateTime, info='创建时间')
    is_del = db.Column(db.Integer, server_default=db.FetchedValue(), info='状态 1 为删除, 0为未删除 ')
    name = db.Column(db.String(64))
    url = db.Column(db.String(255))



class CdbTaskLog(db.Model):
    __tablename__ = 'cdb_task_log'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog0(db.Model):
    __tablename__ = 'cdb_task_log_0'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog1(db.Model):
    __tablename__ = 'cdb_task_log_1'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog2(db.Model):
    __tablename__ = 'cdb_task_log_2'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog3(db.Model):
    __tablename__ = 'cdb_task_log_3'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog4(db.Model):
    __tablename__ = 'cdb_task_log_4'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog5(db.Model):
    __tablename__ = 'cdb_task_log_5'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog6(db.Model):
    __tablename__ = 'cdb_task_log_6'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog7(db.Model):
    __tablename__ = 'cdb_task_log_7'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog8(db.Model):
    __tablename__ = 'cdb_task_log_8'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



class CdbTaskLog9(db.Model):
    __tablename__ = 'cdb_task_log_9'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    operator_uid = db.Column(db.Integer, nullable=False, index=True, info='操作人uid')
    type = db.Column(db.String(32), nullable=False, info='事件类型')
    create_time = db.Column(db.DateTime, info='创建时间')
    content = db.Column(db.Text, info='事件内容')
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    up_field = db.Column(db.String(32))
    reason = db.Column(db.String(100), info='修改原因')



# class CdbTaskModule.bak(db.Model):
#     __tablename__ = 'cdb_task_module.bak'
#
#     id = db.Column(db.Integer, primary_key=True)
#     name = db.Column(db.Integer, nullable=False)
#     version = db.Column(db.String(15), nullable=False, info='版本号')
#     description = db.Column(db.Text, info='详细描述')
#     create_uid = db.Column(db.Integer, nullable=False, info='创建用户id')
#     owner_uid = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='任务所属 用户id,多个 |分隔')
#     level = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='任务等级，不同等级对应不同颜色')
#     status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='0 关闭，1开启，2暂停')



class CdbTaskOwnerLog(db.Model):
    __tablename__ = 'cdb_task_owner_log'

    id = db.Column(db.Integer, primary_key=True)
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    assignor_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='指派人uid')
    owner_uid = db.Column(db.Integer, nullable=False, info='任务所属 用户id')
    create_time = db.Column(db.DateTime, info='创建时间')



class CdbTaskTime(db.Model):
    __tablename__ = 'cdb_task_time'
    __bind_key__ = 'venus'

    tid = db.Column(db.Integer, primary_key=True, info='ID ')
    task_id = db.Column(db.Integer, nullable=False, unique=True, info='项目ID')
    need_department = db.Column(db.String(100), info='需求部门')
    manager = db.Column(db.String(50), nullable=False, info='产品经理')
    develop = db.Column(db.String(50), info='技术负责人')
    manager_time = db.Column(db.Float, server_default=db.FetchedValue(), info='产品工时')
    design_time = db.Column(db.Float, server_default=db.FetchedValue(), info='设计工时')
    comment_time = db.Column(db.Float, server_default=db.FetchedValue(), info='会议工时')
    other_time = db.Column(db.Float, server_default=db.FetchedValue(), info='其他工时')
    department_11 = db.Column(db.Float, server_default=db.FetchedValue(), info='APP研发组')
    department_12 = db.Column(db.Float, server_default=db.FetchedValue(), info='项目一组工时')
    department_13 = db.Column(db.Float, server_default=db.FetchedValue(), info='项目二组工时')
    department_14 = db.Column(db.Float, server_default=db.FetchedValue(), info='项目三组工时')
    department_15 = db.Column(db.Float, server_default=db.FetchedValue(), info='终端支持组工时')
    department_16 = db.Column(db.Float, server_default=db.FetchedValue(), info='前端组工时')
    department_17 = db.Column(db.Float, server_default=db.FetchedValue(), info='项目四组工时')
    department_18 = db.Column(db.Float, server_default=db.FetchedValue(), info='运维组工时')
    department_19 = db.Column(db.Float, server_default=db.FetchedValue(), info='质量保障组工时')
    department_21 = db.Column(db.Float, server_default=db.FetchedValue(), info='大数据组工时')
    develop_total = db.Column(db.Float, server_default=db.FetchedValue(), info='技术部总工时')
    total = db.Column(db.Float, server_default=db.FetchedValue(), info='总工时')
    is_overtime = db.Column(db.Integer, server_default=db.FetchedValue(), info='是否延期')
    over_reason = db.Column(db.String(255), info='延期原因')
    content = db.Column(db.Text, info='备注')
    bug_fate = db.Column(db.Float(10), info='bug率')
    update_time = db.Column(db.DateTime)



class CdbTaskTimeLog(db.Model):
    __tablename__ = 'cdb_task_time_log'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True)
    time_id = db.Column(db.Integer, nullable=False, info='工时统计ID')
    content = db.Column(db.String(100), nullable=False, info='操作记录')
    update_time = db.Column(db.DateTime, nullable=False, info='记录时间')



class CdbTaskToMantisBug(db.Model):
    __tablename__ = 'cdb_task_to_mantis_bug'

    id = db.Column(db.Integer, primary_key=True)
    task_id = db.Column(db.Integer, nullable=False, info='任务id')
    bug_id = db.Column(db.Integer, nullable=False, index=True, info='mantis bug id')
    dateline = db.Column(db.Integer, nullable=False, info='创建时间 时间戳')



class CdbTaskToMantisVersion(db.Model):
    __tablename__ = 'cdb_task_to_mantis_version'

    id = db.Column(db.Integer, primary_key=True)
    task_id = db.Column(db.Integer, nullable=False, index=True, info='任务id')
    version = db.Column(db.String(64), nullable=False, info='mantis 中的version，根据version 可以获取 产品id和具体bug')



class CdbThread(db.Model):
    __tablename__ = 'cdb_thread'
    __table_args__ = (
        db.Index('type_create_timestamp', 'type', 'create_timestamp'),
        db.Index('type_authorid', 'type', 'authorid')
    )

    id = db.Column(db.Integer, primary_key=True)
    authorid = db.Column(db.Integer, nullable=False, info='发帖人id')
    create_date = db.Column(db.DateTime, info='创建时间,日期格式')
    create_timestamp = db.Column(db.Integer, server_default=db.FetchedValue(), info='创建时间，时间戳')
    update_date = db.Column(db.DateTime, info='修改时间,日期格式')
    lastupdate_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='最后一次修改人id')
    is_del = db.Column(db.Integer, server_default=db.FetchedValue(), info='是否被删除，1被删除，0未被删除')
    subject = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='标题')
    content = db.Column(db.Text, info='内容')
    type = db.Column(db.String(25), nullable=False, info='帖子类型，使用英文字符串')



class CdbWeeklyReport(db.Model):
    __tablename__ = 'cdb_weekly_report'

    id = db.Column(db.Integer, primary_key=True)
    create_uid = db.Column(db.Integer, nullable=False, index=True, info='创建人uid')
    create_time = db.Column(db.DateTime, info='创建时间')
    select_uid = db.Column(db.String(255), server_default=db.FetchedValue(), info='选择的用户id，42|0,43|1, uid|status 多个使用“,”分隔')
    option_start_time = db.Column(db.DateTime, info='选择开始时间')
    option_end_time = db.Column(db.DateTime, info='选择结束时间')
    employ_or_leave = db.Column(db.Text, nullable=False, info='员工招聘或者离职')
    team_building = db.Column(db.Text)
    flash_point = db.Column(db.Text, info='闪光点')
    problem = db.Column(db.Text, info='问题')
    is_del = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue())
    update_uid = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue())
    title = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue())
    summary = db.Column(db.Text)



class CdbZan(db.Model):
    __tablename__ = 'cdb_zan'
    __table_args__ = (
        db.Index('type_type_id', 'type', 'type_id'),
    )

    id = db.Column(db.Integer, primary_key=True)
    uid = db.Column(db.Integer, nullable=False, info='点赞人uid')
    type = db.Column(db.String(25), nullable=False, info='点赞类型')
    is_comment = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否是评论点赞，0 不是，1 是。。如果type可以分辨主帖回帖可以不使用此字段')
    type_id = db.Column(db.Integer, nullable=False, info='被点赞类型的id')



class CdbZanCount(db.Model):
    __tablename__ = 'cdb_zan_count'
    __table_args__ = (
        db.Index('type_type_id', 'type', 'type_id'),
    )

    id = db.Column(db.Integer, primary_key=True)
    zan_num = db.Column(db.Integer, nullable=False, info='点赞数量')
    type = db.Column(db.String(25), nullable=False, info='点赞类型')
    is_comment = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否是评论点赞，0 不是，1 是。如果type可以分辨主帖回帖可以不使用此字段')
    type_id = db.Column(db.Integer, nullable=False, info='被点赞类型的id')



class NeedDepartment(db.Model):
    __tablename__ = 'need_department'

    id = db.Column(db.Integer, primary_key=True)
    department_name = db.Column(db.String(100), nullable=False, info='需求部门名称')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='状态')



t_ot_auth_extend = db.Table(
    'ot_auth_extend',
    db.Column('group_id', db.Integer, nullable=False, index=True, info='用户id'),
    db.Column('extend_id', db.Integer, nullable=False, index=True, info='扩展表中数据的id'),
    db.Column('type', db.Integer, nullable=False, info='扩展类型标识 1:栏目分类权限;2:模型权限'),
    db.Index('group_extend_type', 'group_id', 'extend_id', 'type')
)



class OtAuthGroup(db.Model):
    __tablename__ = 'ot_auth_group'

    id = db.Column(db.Integer, primary_key=True, info='用户组id,自增主键')
    module = db.Column(db.String(20), nullable=False, server_default=db.FetchedValue(), info='用户组所属模块')
    type = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='组类型')
    title = db.Column(db.String(20), nullable=False, server_default=db.FetchedValue(), info='用户组中文名称')
    description = db.Column(db.String(80), nullable=False, server_default=db.FetchedValue(), info='描述信息')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='用户组状态：为1正常，为0禁用,-1为删除')
    rules = db.Column(db.String(500), nullable=False, server_default=db.FetchedValue(), info='用户组拥有的规则id，多个规则 , 隔开')
    product_type = db.Column(db.String(16), server_default=db.FetchedValue(), info='菜单的产品类型，当前项目产品类型 projectX(卡家实验室)')



t_ot_auth_group_access = db.Table(
    'ot_auth_group_access',
    db.Column('uid', db.Integer, nullable=False, index=True, info='用户id'),
    db.Column('group_id', db.Integer, nullable=False, index=True, info='用户组id'),
    db.Index('uid_group_id', 'uid', 'group_id')
)



class OtAuthRule(db.Model):
    __tablename__ = 'ot_auth_rule'
    __table_args__ = (
        db.Index('module', 'module', 'status', 'type'),
    )

    id = db.Column(db.Integer, primary_key=True, info='规则id,自增主键')
    module = db.Column(db.String(20), nullable=False, info='规则所属module')
    type = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='1-url;2-主菜单')
    name = db.Column(db.String(80), nullable=False, server_default=db.FetchedValue(), info='规则唯一英文标识')
    title = db.Column(db.String(20), nullable=False, server_default=db.FetchedValue(), info='规则中文描述')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否有效(0:无效,1:有效)')
    condition = db.Column(db.String(300), nullable=False, server_default=db.FetchedValue(), info='规则附加条件')
    menu_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='菜单的id')



class OtMember(db.Model):
    __tablename__ = 'ot_member'

    uid = db.Column(db.Integer, primary_key=True, info='用户ID')
    nickname = db.Column(db.String(16), nullable=False, unique=True, server_default=db.FetchedValue(), info='昵称')
    sex = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='性别 1 男 2女  0 未知')
    birthday = db.Column(db.Date, nullable=False, server_default=db.FetchedValue(), info='生日')
    qq = db.Column(db.String(10), nullable=False, server_default=db.FetchedValue(), info='qq号')
    score = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='用户积分')
    login = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='登录次数')
    reg_ip = db.Column(db.BigInteger, nullable=False, server_default=db.FetchedValue(), info='注册IP')
    reg_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='注册时间')
    last_login_ip = db.Column(db.BigInteger, nullable=False, server_default=db.FetchedValue(), info='最后登录IP')
    last_login_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='最后登录时间')
    status = db.Column(db.Integer, nullable=False, index=True, server_default=db.FetchedValue(), info='会员状态')
    username = db.Column(db.String(16), nullable=False, unique=True, server_default=db.FetchedValue())
    password = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue())
    email = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue())
    mobile = db.Column(db.String(11), nullable=False, server_default=db.FetchedValue())
    type = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue())
    avatar = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue())
    job_number = db.Column(db.String(8), nullable=False, server_default=db.FetchedValue(), info='工号')
    ID_card = db.Column(db.String(18), nullable=False, server_default=db.FetchedValue(), info='身份证号')
    department = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue(), info='所在部门名称')
    ding_talk_userid = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue(), info='钉钉账号id')



class OtMemberBak(db.Model):
    __tablename__ = 'ot_member_bak'

    uid = db.Column(db.Integer, primary_key=True, info='用户ID')
    nickname = db.Column(db.String(16), nullable=False, unique=True, server_default=db.FetchedValue(), info='昵称')
    sex = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='性别 1 男 2女  0 未知')
    birthday = db.Column(db.Date, nullable=False, server_default=db.FetchedValue(), info='生日')
    qq = db.Column(db.String(10), nullable=False, server_default=db.FetchedValue(), info='qq号')
    score = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='用户积分')
    login = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='登录次数')
    reg_ip = db.Column(db.BigInteger, nullable=False, server_default=db.FetchedValue(), info='注册IP')
    reg_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='注册时间')
    last_login_ip = db.Column(db.BigInteger, nullable=False, server_default=db.FetchedValue(), info='最后登录IP')
    last_login_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='最后登录时间')
    status = db.Column(db.Integer, nullable=False, index=True, server_default=db.FetchedValue(), info='会员状态')
    username = db.Column(db.String(16), nullable=False, unique=True, server_default=db.FetchedValue())
    password = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue())
    email = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue())
    mobile = db.Column(db.String(11), nullable=False, server_default=db.FetchedValue())
    type = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue())
    avatar = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue())
    job_number = db.Column(db.String(8), nullable=False, server_default=db.FetchedValue(), info='工号')
    ID_card = db.Column(db.String(18), nullable=False, server_default=db.FetchedValue(), info='身份证号')
    department = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue(), info='所在部门名称')
    ding_talk_userid = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue(), info='钉钉账号id')



class OtMemberTest(db.Model):
    __tablename__ = 'ot_member_test'

    uid = db.Column(db.Integer, primary_key=True, info='用户ID')
    department = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue(), info='所在部门名称')
    ding_talk_userid = db.Column(db.String(32), nullable=False, server_default=db.FetchedValue(), info='钉钉账号id')



class OtMenu(db.Model):
    __tablename__ = 'ot_menu'
    __table_args__ = (
        db.Index('pid_sort', 'pid', 'sort'),
    )

    id = db.Column(db.Integer, primary_key=True, info='文档ID')
    title = db.Column(db.String(50), nullable=False, server_default=db.FetchedValue(), info='标题')
    pid = db.Column(db.Integer, nullable=False, index=True, server_default=db.FetchedValue(), info='上级分类ID')
    sort = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='排序（同级有效）')
    url = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='链接地址')
    hide = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否隐藏')
    tip = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='提示')
    group = db.Column(db.String(50), server_default=db.FetchedValue(), info='分组')
    is_dev = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否仅开发者模式可见')
    status = db.Column(db.Integer, nullable=False, index=True, server_default=db.FetchedValue(), info='状态')
    icon = db.Column(db.String(20), server_default=db.FetchedValue())
    icon1 = db.Column(db.String(20), nullable=False, server_default=db.FetchedValue(), info='新的图标')
    url_vue = db.Column(db.String(255), server_default=db.FetchedValue())
    icon_vue = db.Column(db.String(32), server_default=db.FetchedValue())
    product_type = db.Column(db.String(16), server_default=db.FetchedValue(), info='菜单的产品类型，当前项目产品类型 projectX(卡家实验室)')



class OtQuarterSummary(db.Model):
    __tablename__ = 'ot_quarter_summary'

    id = db.Column(db.Integer, primary_key=True)
    uid = db.Column(db.Integer, nullable=False, info='用户ID')
    username = db.Column(db.String(50), nullable=False, info='员工姓名')
    entry_time = db.Column(db.DateTime, nullable=False, info='入职时间')
    first_department = db.Column(db.String(50), nullable=False, info='一级部门')
    second_department = db.Column(db.String(50), nullable=False, info='二级部门')
    station = db.Column(db.String(100), nullable=False, info='所属岗位')
    leader = db.Column(db.String(50), nullable=False, info='直属领导')
    summary = db.Column(db.Text, nullable=False, info='总结')
    comment = db.Column(db.Text, nullable=False, info='领导评价')
    create_time = db.Column(db.DateTime, nullable=False, info='创建时间')
    quarter = db.Column(db.DateTime, nullable=False, info='季度')



class OtUcenterAdmin(db.Model):
    __tablename__ = 'ot_ucenter_admin'

    id = db.Column(db.Integer, primary_key=True, info='管理员ID')
    member_id = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='管理员用户ID')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='管理员状态')



class OtUcenterMember(db.Model):
    __tablename__ = 'ot_ucenter_member'

    id = db.Column(db.Integer, primary_key=True, info='用户ID')
    username = db.Column(db.String(16), nullable=False, unique=True, info='用户名')
    password = db.Column(db.String(32), nullable=False, info='密码')
    email = db.Column(db.String(32), nullable=False, unique=True, info='用户邮箱')
    mobile = db.Column(db.String(15), nullable=False, server_default=db.FetchedValue(), info='用户手机')
    reg_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='注册时间')
    reg_ip = db.Column(db.BigInteger, nullable=False, server_default=db.FetchedValue(), info='注册IP')
    last_login_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='最后登录时间')
    last_login_ip = db.Column(db.BigInteger, nullable=False, server_default=db.FetchedValue(), info='最后登录IP')
    update_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='更新时间')
    status = db.Column(db.Integer, index=True, server_default=db.FetchedValue(), info='用户状态')



class OtUrl(db.Model):
    __tablename__ = 'ot_url'

    id = db.Column(db.Integer, primary_key=True, info='链接唯一标识')
    url = db.Column(db.String(255), nullable=False, unique=True, server_default=db.FetchedValue(), info='链接地址')
    short = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue(), info='短网址')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='状态')
    create_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='创建时间')



t_ot_userdata = db.Table(
    'ot_userdata',
    db.Column('uid', db.Integer, nullable=False, info='用户id'),
    db.Column('type', db.Integer, nullable=False, info='类型标识'),
    db.Column('target_id', db.Integer, nullable=False, info='目标id'),
    db.Index('uid', 'uid', 'type', 'target_id')
)



t_rc_auth_extend = db.Table(
    'rc_auth_extend',
    db.Column('group_id', db.Integer, nullable=False, index=True, info='用户id'),
    db.Column('extend_id', db.Integer, nullable=False, index=True, info='扩展表中数据的id'),
    db.Column('type', db.Integer, nullable=False, info='扩展类型标识 1:栏目分类权限;2:模型权限'),
    db.Index('group_extend_type', 'group_id', 'extend_id', 'type')
)



class RcAuthGroup(db.Model):
    __tablename__ = 'rc_auth_group'

    id = db.Column(db.Integer, primary_key=True, info='用户组id,自增主键')
    module = db.Column(db.String(20), nullable=False, server_default=db.FetchedValue(), info='用户组所属模块')
    type = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='组类型')
    title = db.Column(db.String(20), nullable=False, server_default=db.FetchedValue(), info='用户组中文名称')
    description = db.Column(db.String(80), nullable=False, server_default=db.FetchedValue(), info='描述信息')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='用户组状态：为1正常，为0禁用,-1为删除')
    rules = db.Column(db.String(500), nullable=False, server_default=db.FetchedValue(), info='用户组拥有的规则id，多个规则 , 隔开')



t_rc_auth_group_access = db.Table(
    'rc_auth_group_access',
    db.Column('uid', db.Integer, nullable=False, index=True, info='用户id'),
    db.Column('group_id', db.Integer, nullable=False, index=True, info='用户组id'),
    db.Index('uid_group_id', 'uid', 'group_id')
)



class RcAuthRule(db.Model):
    __tablename__ = 'rc_auth_rule'
    __table_args__ = (
        db.Index('module', 'module', 'status', 'type'),
    )

    id = db.Column(db.Integer, primary_key=True, info='规则id,自增主键')
    module = db.Column(db.String(20), nullable=False, info='规则所属module')
    type = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='1-url;2-主菜单')
    name = db.Column(db.String(80), nullable=False, server_default=db.FetchedValue(), info='规则唯一英文标识')
    title = db.Column(db.String(20), nullable=False, server_default=db.FetchedValue(), info='规则中文描述')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否有效(0:无效,1:有效)')
    condition = db.Column(db.String(300), nullable=False, server_default=db.FetchedValue(), info='规则附加条件')



class RcMember(db.Model):
    __tablename__ = 'rc_member'

    uid = db.Column(db.Integer, primary_key=True, info='用户ID')
    username = db.Column(db.String(20), unique=True, info='用户名')
    password = db.Column(db.String(50), info='登录密码')
    nickname = db.Column(db.String(16), info='昵称')
    sex = db.Column(db.Integer, info='性别')
    birthday = db.Column(db.Date, info='生日')
    qq = db.Column(db.String(10), info='qq号')
    email = db.Column(db.String(50), info='电子邮件')
    score = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='用户积分')
    login = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='登录次数')
    reg_ip = db.Column(db.BigInteger, nullable=False, server_default=db.FetchedValue(), info='注册IP')
    reg_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='注册时间')
    last_login_ip = db.Column(db.BigInteger, nullable=False, server_default=db.FetchedValue(), info='最后登录IP')
    last_login_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='最后登录时间')
    status = db.Column(db.Integer, nullable=False, index=True, server_default=db.FetchedValue(), info='会员状态')



class RcMenu(db.Model):
    __tablename__ = 'rc_menu'

    id = db.Column(db.Integer, primary_key=True, info='文档ID')
    title = db.Column(db.String(50), nullable=False, server_default=db.FetchedValue(), info='标题')
    pid = db.Column(db.Integer, nullable=False, index=True, server_default=db.FetchedValue(), info='上级分类ID')
    sort = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='排序（同级有效）')
    url = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='链接地址')
    hide = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否隐藏')
    tip = db.Column(db.String(255), nullable=False, server_default=db.FetchedValue(), info='提示')
    group = db.Column(db.String(50), server_default=db.FetchedValue(), info='分组')
    is_dev = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否仅开发者模式可见')
    status = db.Column(db.Integer, nullable=False, index=True, server_default=db.FetchedValue(), info='状态')
    icon = db.Column(db.String(20), server_default=db.FetchedValue())



class RcUrl(db.Model):
    __tablename__ = 'rc_url'

    id = db.Column(db.Integer, primary_key=True, info='链接唯一标识')
    url = db.Column(db.String(255), nullable=False, unique=True, server_default=db.FetchedValue(), info='链接地址')
    short = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue(), info='短网址')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='状态')
    create_time = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='创建时间')



t_rc_userdata = db.Table(
    'rc_userdata',
    db.Column('uid', db.Integer, nullable=False, info='用户id'),
    db.Column('type', db.Integer, nullable=False, info='类型标识'),
    db.Column('target_id', db.Integer, nullable=False, info='目标id'),
    db.Index('uid', 'uid', 'type', 'target_id')
)



class TApp(db.Model):
    __tablename__ = 't_app'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(50), info='名称')
    icon_src = db.Column(db.String(255), info='图标路径')
    score = db.Column(db.Integer, info='评分')
    size = db.Column(db.Integer, info='应用大小')
    and_link = db.Column(db.String(255), info='安卓下载地址')
    ios_link = db.Column(db.String(255), info='ios下载')
    create_time = db.Column(db.Integer, info='添加时间')
    type = db.Column(db.Integer, info='应用类型')
    count = db.Column(db.Integer, info='点击次数')



class TCoupon(db.Model):
    __tablename__ = 't_coupon'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(50), info='名称')
    describe = db.Column(db.Text, info='描述')
    amount = db.Column(db.Integer, info='抵用金额')
    create_time = db.Column(db.Integer, info='添加时间')
    status = db.Column(db.Integer, server_default=db.FetchedValue(), info='0.禁用；1.正常；')



class TCrm(db.Model):
    __tablename__ = 't_crm'

    id = db.Column(db.Integer, primary_key=True, info='CRM ID')
    customer_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='客户ID')
    title = db.Column(db.String(50), info='标题')
    route = db.Column(db.String(50), info='发布渠道')
    expect_money = db.Column(db.String(8), info='期望金额')
    offer_money = db.Column(db.String(8), info='报价')
    status = db.Column(db.Integer, server_default=db.FetchedValue(), info='状态 0.意向客户；1:沟通中；2：有意愿合作；3:合作成功；4：合作失败')
    create_time = db.Column(db.Integer, server_default=db.FetchedValue(), info='发布时间')
    end_time = db.Column(db.Integer, server_default=db.FetchedValue(), info='期望完成时间')
    member_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='创建人ID')
    describe = db.Column(db.Text, info='详情描述')
    comment = db.Column(db.Integer, server_default=db.FetchedValue(), info='评论数')
    record_end_time = db.Column(db.Integer, server_default=db.FetchedValue(), info='最后沟通记录时间')



class TCrmRelate(db.Model):
    __tablename__ = 't_crm_relate'

    id = db.Column(db.Integer, primary_key=True, info='CRM ID')
    crm_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='crm_ID')
    member_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='创建人ID')
    create_time = db.Column(db.Integer, server_default=db.FetchedValue(), info='发布时间')
    dialogue = db.Column(db.Text, info='详情描述')



class TCustomer(db.Model):
    __tablename__ = 't_customer'

    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(50), nullable=False, info='用户名')
    company_name = db.Column(db.String(50), nullable=False, info='公司名')
    sex = db.Column(db.String(4), info='性别')
    weichat = db.Column(db.String(50), info='微信')
    email = db.Column(db.String(50), info='email')
    phone = db.Column(db.Integer, server_default=db.FetchedValue(), info='电话')
    QQ = db.Column(db.Integer, server_default=db.FetchedValue(), info='QQ')
    code = db.Column(db.Integer, server_default=db.FetchedValue(), info='邮编')
    provice = db.Column(db.String(20), info='省')
    city = db.Column(db.String(20), info='市')
    crm_id = db.Column(db.Integer, info='项目ID')
    area = db.Column(db.String(30), info='区域')



t_t_elend = db.Table(
    't_elend',
    db.Column('id', db.Integer, nullable=False),
    db.Column('elend_id', db.Integer, info='好E贷条目ID'),
    db.Column('user_id', db.Integer, info='用户ID'),
    db.Column('lender_id', db.Integer, info='放款人ID'),
    db.Column('amount', db.Integer, info='借款金额'),
    db.Column('create_time', db.Integer, info='借款日期'),
    db.Column('repay_time', db.Integer, info='还款日期'),
    db.Column('purpose', db.Integer, info='用途'),
    db.Column('interest', db.Integer, info='利息'),
    db.Column('service_fee', db.Integer, info='服务费'),
    db.Column('status', db.Integer, info='0.待确认；1.已确认；2.已拒绝；3.已放款；4.逾期；5.已完成')
)



t_t_elend_item = db.Table(
    't_elend_item',
    db.Column('id', db.Integer, nullable=False),
    db.Column('lender_id', db.Integer, info='放贷人ID'),
    db.Column('address', db.String(50), info='地点'),
    db.Column('min_amount', db.Integer, info='最低额度'),
    db.Column('max_amount', db.Integer, info='最高额度'),
    db.Column('repay_rate', db.Float(5), info='利率'),
    db.Column('access_rate', db.Float(5), info='通过率'),
    db.Column('circle_time', db.String(50), info='周期')
)



class TFile(db.Model):
    __tablename__ = 't_file'

    Id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(50), info='文件标题')
    describe = db.Column(db.Text, info='文件描述')
    file_ids = db.Column(db.Text, info='文件id集')
    upload_time = db.Column(db.Integer, info='上传时间')
    uploader_id = db.Column(db.Integer)
    tags = db.Column(db.Text, info='标签')



class TFileSrc(db.Model):
    __tablename__ = 't_file_src'

    Id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(50), info='文件名称')
    src = db.Column(db.String(100), info='文件路径')
    upload_time = db.Column(db.Integer, info='上传时间')



class TFileTag(db.Model):
    __tablename__ = 't_file_tag'

    Id = db.Column(db.Integer, primary_key=True)
    file_id = db.Column(db.Integer, info='文件组ID')
    tag = db.Column(db.String(50), info='文件标签')



t_t_lend = db.Table(
    't_lend',
    db.Column('id', db.Integer, nullable=False),
    db.Column('user_id', db.Integer, info='用户ID'),
    db.Column('amount', db.Integer, info='借款金额'),
    db.Column('lend_time', db.Integer, info='借款时间'),
    db.Column('repay_time', db.Integer, info='还款时间'),
    db.Column('service_fee', db.Integer, info='服务费用'),
    db.Column('bank_card', db.String(50), info='银行卡号'),
    db.Column('stage_type', db.Integer, info='分期类型：'),
    db.Column('status', db.Integer, info='订单状态：0.待放款；1.已还款；2.已放款+待还款；3.还款中；4.逾期；')
)



t_t_lend_stage = db.Table(
    't_lend_stage',
    db.Column('id', db.Integer, nullable=False),
    db.Column('lend_id', db.Integer, info='订单号'),
    db.Column('amount', db.Integer, info='分期还款金额'),
    db.Column('interest', db.Integer, info='利息'),
    db.Column('service_fee', db.Integer, info='服务费用'),
    db.Column('late_fee', db.Integer, info='滞纳金'),
    db.Column('coupon_id', db.Integer, server_default=db.FetchedValue(), info='优惠券ID'),
    db.Column('repay_time', db.Integer, info='还款时间'),
    db.Column('status', db.Integer, server_default=db.FetchedValue(), info='0.待还款；1.已还款；2.逾期')
)



t_t_loop_img = db.Table(
    't_loop_img',
    db.Column('id', db.Integer, nullable=False),
    db.Column('title', db.String(50), info='标题'),
    db.Column('describe', db.Text, info='描述'),
    db.Column('src', db.String(255), info='路径'),
    db.Column('create_time', db.Integer, info='上传时间'),
    db.Column('type', db.Integer)
)



t_t_message = db.Table(
    't_message',
    db.Column('id', db.Integer, nullable=False),
    db.Column('user_id', db.Integer, info='用户ID'),
    db.Column('title', db.String(50), info='标题'),
    db.Column('content', db.Text, info='内容'),
    db.Column('type', db.Integer, info='消息类别'),
    db.Column('status', db.Integer, server_default=db.FetchedValue(), info='状态：1.未读；2.已读')
)



class TMissionType(db.Model):
    __tablename__ = 't_mission_type'

    id = db.Column(db.Integer, primary_key=True, server_default=db.FetchedValue(), info='任务类型：1.催收；2.邀请好友')
    title = db.Column(db.String(50), info='标题')
    reward_type = db.Column(db.Integer, server_default=db.FetchedValue(), info='奖励类型：1.优惠券；2.现金')
    reward_amount = db.Column(db.Integer, info='奖励金额')
    reward_coupon_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='优惠券ID')



class TProject(db.Model):
    __tablename__ = 't_project'
    __bind_key__ = 'venus'

    id = db.Column(db.Integer, primary_key=True, info='项目ID')
    member_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='创建人ID')
    name = db.Column(db.String(50), info='项目名称')
    background = db.Column(db.String(20), info='项目背景  bedad3,f28033,ebc656,a2d148,20bfa3,56b8eb,7461c2')
    status = db.Column(db.Integer, server_default=db.FetchedValue(), info='状态 0.关闭；1:开启；2：暂停')
    create_time = db.Column(db.Integer, server_default=db.FetchedValue(), info='创建时间')
    describe = db.Column(db.Text, info='详情描述')
    version = db.Column(db.String(15), nullable=False, server_default=db.FetchedValue())
    display_order = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='显示顺序')
    type = db.Column(db.String(15), nullable=False, index=True, server_default=db.FetchedValue(), info='项目类型: common 默认项目, product 产品经理项目')
    is_private = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是否私有 1 私有 -1 非私有')
    task_expire_weeks = db.Column(db.SmallInteger, nullable=False, server_default=db.FetchedValue(), info='项目中已完成的任务超过 n周不显示。0表示无此限制')



class TProjectBug(db.Model):
    __tablename__ = 't_project_bug'

    id = db.Column(db.Integer, primary_key=True)
    member_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='创建人ID')
    project_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='项目ID')
    appoint_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='被指派者ID')
    version_number = db.Column(db.String(20), info='版本号')
    type = db.Column(db.String(20), info='问题类型')
    level = db.Column(db.String(20), info='优先级')
    module = db.Column(db.String(20), info='模块')
    create_time = db.Column(db.Integer, server_default=db.FetchedValue(), info='bug创建时间')
    end_time = db.Column(db.Integer, server_default=db.FetchedValue(), info='bug结束时间')
    status = db.Column(db.Integer, server_default=db.FetchedValue(), info='状态 0.关闭；1:新建；2：处理中；3:已解决；4：未解决；5:待反馈；')
    describe = db.Column(db.Text, info='详情描述')



class TProjectBugFile(db.Model):
    __tablename__ = 't_project_bug_file'

    id = db.Column(db.Integer, primary_key=True)
    bug_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='bugID')
    file_name = db.Column(db.String(20), info='文件名称')
    file_size = db.Column(db.String(16), info='文件大小')
    file_time = db.Column(db.Integer, server_default=db.FetchedValue(), info='文件上传时间')
    src = db.Column(db.String(100), info='文件路径')
    member_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='创建人ID')



class TProjectBugRemark(db.Model):
    __tablename__ = 't_project_bug_remark'

    id = db.Column(db.Integer, primary_key=True)
    bug_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='bugID')
    remark = db.Column(db.Text, info='备注')
    member_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='创建人ID')



class TProjectConcern(db.Model):
    __tablename__ = 't_project_concern'
    __table_args__ = (
        db.Index('twoId', 'project_id', 'member_id'),
    )

    id = db.Column(db.Integer, primary_key=True)
    project_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='项目ID')
    member_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='成员ID')



class TProjectMember(db.Model):
    __tablename__ = 't_project_member'
    __table_args__ = (
        db.Index('twoId', 'project_id', 'member_id'),
    )

    id = db.Column(db.Integer, primary_key=True)
    project_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='项目ID')
    member_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='成员ID')
    is_manager = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='是不是项目管理者 1 是 0 不是')



class TProjectVersion(db.Model):
    __tablename__ = 't_project_version'

    id = db.Column(db.Integer, primary_key=True)
    member_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='创建人ID')
    project_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='项目ID')
    version_number = db.Column(db.String(20), info='版本号')
    type = db.Column(db.String(20), info='类型')
    tag = db.Column(db.String(20), info='标签')
    file_name = db.Column(db.String(20), info='文件名称')
    file_size = db.Column(db.String(16), info='文件大小')
    file_time = db.Column(db.Integer, server_default=db.FetchedValue(), info='文件上传时间')
    src = db.Column(db.String(100), info='文件路径')
    describe = db.Column(db.Text, info='详情描述')



t_t_user = db.Table(
    't_user',
    db.Column('id', db.Integer, nullable=False),
    db.Column('username', db.String(50), info='用户名/手机号'),
    db.Column('nickname', db.String(50), info='用户昵称'),
    db.Column('password', db.String(50), info='登录密码'),
    db.Column('pay_pass', db.String(50), info='支付密码'),
    db.Column('login_count', db.Integer, info='登录次数'),
    db.Column('last_ip', db.String(50), info='最后登录IP'),
    db.Column('create_time', db.Integer),
    db.Column('balance', db.Integer, server_default=db.FetchedValue(), info='余额'),
    db.Column('lend_amount', db.Integer, server_default=db.FetchedValue(), info='借款额度'),
    db.Column('has_lend_amount', db.Integer, server_default=db.FetchedValue(), info='已借款额度'),
    db.Column('consume_amount', db.Integer, server_default=db.FetchedValue(), info='消费额度'),
    db.Column('has_consume_amount', db.Integer, server_default=db.FetchedValue(), info='已消费额度'),
    db.Column('position', db.String(50), info='位置信息'),
    db.Column('recommend_id', db.Integer, server_default=db.FetchedValue(), info='推荐人ID'),
    db.Column('status', db.Integer, server_default=db.FetchedValue(), info='用户状态：0.禁用；1.审核成功；2.待审核；3.审核中；4.审核失败')
)



t_t_user_bank = db.Table(
    't_user_bank',
    db.Column('id', db.Integer, nullable=False),
    db.Column('user_id', db.Integer, info='用户ID'),
    db.Column('bank_card', db.String(50), info='银行卡号'),
    db.Column('bank_name', db.String(50), info='发卡行'),
    db.Column('phone', db.String(20), info='手机号')
)



t_t_user_coupon = db.Table(
    't_user_coupon',
    db.Column('id', db.Integer, nullable=False),
    db.Column('user_id', db.Integer, info='用户ID'),
    db.Column('coupon_id', db.Integer, info='优惠券ID'),
    db.Column('create_time', db.Integer, info='获取时间'),
    db.Column('end_time', db.Integer, info='过期时间'),
    db.Column('use_time', db.Integer, info='使用时间'),
    db.Column('status', db.Integer, server_default=db.FetchedValue(), info='0.已使用；1.待使用；2.已过期；')
)



class TUserInfo(db.Model):
    __tablename__ = 't_user_info'

    user_id = db.Column(db.Integer, primary_key=True, server_default=db.FetchedValue())
    truename = db.Column(db.String(50), info='真实姓名')
    address = db.Column(db.String(255), info='家庭住址')
    relative_type = db.Column(db.Integer, info='亲属类别')
    relative_name = db.Column(db.String(50), info='亲属姓名')
    relative_phone = db.Column(db.String(20), info='亲属手机号')
    c1_name = db.Column(db.String(50), info='同学1姓名')
    c1_phone = db.Column(db.String(20), info='同学1手机号')
    c2_name = db.Column(db.String(50), info='同学2姓名')
    c2_phone = db.Column(db.String(20), info='同学2手机号')
    idcard_code = db.Column(db.String(50), info='身份证号')
    idcard_img_1 = db.Column(db.String(255), info='身份证正面照')
    idcard_img_2 = db.Column(db.String(255), info='身份证反面照')



t_t_user_mission = db.Table(
    't_user_mission',
    db.Column('Id', db.Integer, nullable=False),
    db.Column('user_id', db.Integer, info='用户ID'),
    db.Column('type', db.Integer, info='任务类型'),
    db.Column('create_time', db.Integer, info='接收时间'),
    db.Column('accept_end_time', db.Integer, info='接受截止时间'),
    db.Column('end_time', db.Integer, info='结束时间'),
    db.Column('relative_id', db.Integer, info='关联ID'),
    db.Column('status', db.Integer, info='0.待接受；1.已完成；2.待完成；3.未完成；4.为接受；')
)
